Join query ?

  • Note

    inner join
    
                    $this->db->select('*');
                    $this->db->from('orders');
                    $this->db->join('users', 'users.id = orders.user_id');
                    $query = $this->db->get();
    
                    $result= $query->result();
    
                    
    left join

    note the third parameter in the join() function

    
                    $this->db->select('*');
                    $this->db->from('orders');
                    $this->db->join('users', 'users.id = orders.user_id' ,'left' );
                    $query = $this->db->get();
    
                    $result= $query->result();